package com.develop.BeanUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

@Component
public class KafkaSender {
	@Autowired
	private KafkaTemplate<String, String> kafkaTemplate;

	// 发送消息方法
	public void send(String topic, String data) {
		kafkaTemplate.send(topic, data);
	}
}
